/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import AO.Qualification;
import dbconnector.DBDriver;
import java.sql.PreparedStatement;

/**
 *
 * @author HONEY
 */
public class QualificationDAO 
{
    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author HONEY
 */
  public static boolean save(Qualification q) 
  {
    try
    {
        
           
      PreparedStatement pstmt = DBDriver.getPrepare("insert into qualificationdetails values(?,?,?,?,?,?)");
      pstmt.setString(1, q.getUsername());
      pstmt.setString(2, q.getCoursename());
      pstmt.setString(3, q.getYop());
      pstmt.setString(4, q.getBoard());
      pstmt.setFloat(5, q.getPercentage());
      pstmt.setString(6, q.getOptionals());
      
      int i=pstmt.executeUpdate();
      if(i==1)
          return true;
    }
    catch (Exception ex)
    {ex.printStackTrace();
        return false;
    }
    return false;
  }
     
    
}

